package com.xiaoshuidi.cloud.module.rooms.enums;

import cn.hutool.core.lang.Assert;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum FeatureTagEnum {
    TAG_METRO("tag_metro","离地铁近"),
    TAG_BALCONY("tag_balcony","独立阳台"),
    TAG_TOILET("tag_toilet","独立卫生间"),
    TAG_KITCHEN("tag_kitchen","厨房"),
    TAG_PUB_BALCONY("tag_pub_balcony","公共阳台"),
    TAG_PUB_TOILET("tag_pub_toilet","公共卫生间"),
    ;
    private String value;
    private String name;

    public static String getValueByName(String name) {
        FeatureTagEnum featureTagEnum = Arrays.stream(FeatureTagEnum.values()).filter(p -> p.name.equals(name)).findFirst().orElse(null);
        Assert.isTrue(featureTagEnum != null,"FeatureTagEnum类型:{}不存在",name);
        return featureTagEnum.getValue();
    }
}
